<template>
	<view>
	</view>
</template>

<script>
	import store from "@/store";
	import {
		mapGetters
	} from "vuex";
	export default {
		data() {
			return {
	
				Id: null,
				Detail: null,
           formData:null,
LineUploadList: [],
			}
		},
		computed: {
			...mapGetters(["userInfo", 'userId']),
		},
		onLoad(option) {
			this.Id = option.Id;

		},
		onShow() {
		
				this.GetLineUploadApi();
				this.LineUploadListApi();
			
		},
		methods: {
         /**
			 * 线路实时上报单个查询
			 */
			async GetLineUploadApi() {
				let {
					Data
				} = await this.$http.PostAsync("/LineUpload/Get", {
					Id: this.Id
				});
				this.Detail = Data;
	
			},
			/**
			 * 线路实时上报查询
			 */
			async LineUploadListApi() {
				let {
					Data: {
						Items
					}
				} = await this.$http.PostAsync("/LineUpload/List", {
					
				});
				this.LineUploadList = Items;
			},
         /**
			 * 线路实时上报保存或者修改
			 */
        async Save() {
          let confirm = await this.$comm.ShowModal("你确定要操作吗?");

          if (confirm == false) {
            await this.$comm.ShowToast("用户放弃操作");
            return;
          }
          let {
            Data,
            Success,
          } = await this.$http.PostAsync("/LineUpload/CreateOrEdit", this.formData);
          if (Success) {
            await this.$comm.ShowToast("操作成功");
            await this.$comm.ReturnPage();
          }
          }
			

		}
	}
</script>

<style>
	
</style>